<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html ng-app="userApp">
<head>
<base href="<%=basePath%>">

<title>My JSP 'alarmList.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<style type="text/css">
.controls.inline>* {
	display: inline-block;
}

.controls.inline>input {
	width: 100px;
}
</style>
</head>

<body>
	<input type="hidden" value="${sessionScope.user.password}" id="password"/>
	<div class="row-fluid" ng-controller="userInfoCtrl">
		<!-- block -->
		<div class="block">
			<div class="navbar navbar-inner block-header">
				<div class="muted pull-left">修改密码</div>
			</div>
			<div class="block-content collapse in">
				<form onvalid="valid()" onsubmit="return valid()" class="form-horizontal" id='addUserForm' action="modifyPassword.do?menuId=4&jspName=modifyPassword" method="post">
					<div class="span6">
						<fieldset>
							<legend>修改密码</legend>
							<div class="control-group">
								<label class="control-label" for="focusedInput">原密码:</label>
								<div class="controls">
									<input 
										<input type="password" id="oldPassword">
								</div>
							</div>
							 <div class="control-group">
								<label class="control-label" for="disabledInput">新密码:</label>
								<div class="controls">
									<input <input type="password" id="newPassword" name="newPassword"/>
								</div>
							</div>
							 <div class="control-group">
								<label class="control-label" for="disabledInput">重复新密码:</label>
								<div class="controls">
									<input type="password" id="repeatPassword" name="email"/>
								</div>
							</div>
							<div class="control-group">
								<div class="controls">
									<input type="submit" class="btn btn-primary" value="提交"/>
								</div>
							</div>
						</fieldset>
					</div>
				</form>
			</div>
		</div>
		<!-- /block -->
	</div>
	<script type="text/javascript">
		function valid(){
			var password = $("#password").val();
				oldPasword = $("#oldPassword").val(),
				newPassword = $("#newPassword").val(),
				repeatPassword = $("#repeatPassword").val();
			if(password!=oldPasword){
				alert("原密码不正确！");
				return false;
			}
			if(newPassword!=repeatPassword){
				alert("两次密码不一致！");
				return false;
			}
			return true;
		}
		</script>
	<script>
		/* var app = angular.module('alarmApp', []);
		app.controller('alarmCtrl', function($scope, $http) {
			$http.post("addAlarm.json").success(function(response) {
				$scope.alarmList = response;
			});
		}); */
	</script>
</body>
</html>
